<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<body>
	<h2>Hello World!</h2>
	<p>${student.sid }</p>
	<p>${student.student }</p>
	<p>${student.age }</p>
	<div id="messages"></div>
</body>
<script type="text/javascript">
	var webSocket = new WebSocket('ws://localhost:8888/ssmweb/websocket');
	webSocket.onerror = function(event) {
		alert(event.data);
	};
	//与WebSocket建立连接
	webSocket.onopen = function(event) {
		document.getElementById('messages').innerHTML = '与服务器端建立连接';
	};
	//处理服务器返回的信息
	webSocket.onmessage = function(event) {
		document.getElementById('messages').innerHTML += '<br />' + event.data;
	};
	function start() {
		//向服务器发送请求
		/* webSocket.send('我是jCuckoo'); */
	}
</script>
</html>
